package com.fausto.learnimprint.common.lang

sealed class IResult<T>{
    class Ok<T>(val result: T): IResult<T>()
    class Err<T>(val error: Error): IResult<T>()

    fun unwrap(): T{
        return when(this){
            is Err -> throw this.error
            is Ok -> this.result
        }
    }
}
